package com.etheart.music.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.etheart.datamanagement.service.DatamanagementService;
import com.etheart.framework.core.dao.Page;
import com.etheart.framework.core.fulltextsearch.FullTextQueryParameter;
import com.etheart.framework.core.fulltextsearch.FullTextQueryService;
import com.etheart.model.entity.Singer;

@Service("music_SingerFullTextQueryService")
public class SingerFullTextQueryServiceImp implements SingerFullTextQueryService {
	
	@Autowired
	private FullTextQueryService fullTextQueryService;
	
	@Autowired
	private DatamanagementService datamanamgentService;

	@Transactional(readOnly=true) 
	public Page<Singer> fullTextQuerySinger(String keyword,int pageNo) {
		FullTextQueryParameter<Singer> queryPrame = new FullTextQueryParameter<Singer>(Singer.class, keyword, "singername");
		int pageSize =  datamanamgentService.getIntValue("pageSize");
		return fullTextQueryService.find(queryPrame, pageNo,pageSize);
	}
}
